package o;

import com.huawei.appgallery.jsonkit.api.JsonBean;
import java.lang.reflect.Field;
import java.util.List;

public class cgm extends cvt {
    private String ˏ(Field field, Object obj, boolean z) throws IllegalAccessException, IllegalArgumentException {
        if (obj instanceof JsonBean) {
            StringBuilder stringBuilder = new StringBuilder();
            if (!z) {
                ((JsonBean) obj).toJson(stringBuilder);
                return stringBuilder.toString();
            } else if (JsonBean.isFieldPrivacy(field)) {
                return "****";
            } else {
                if (!JsonBean.isFieldCanPrint(field)) {
                    return "*";
                }
                ((JsonBean) obj).toFilterJson(stringBuilder);
                return stringBuilder.toString();
            }
        } else if (obj == null) {
            return null;
        } else {
            if (z) {
                if (JsonBean.isFieldPrivacy(field)) {
                    obj = "****";
                } else if (!JsonBean.isFieldCanPrint(field)) {
                    obj = "*";
                }
            }
            return String.valueOf(obj);
        }
    }

    protected String getValue(Field field, boolean z) throws IllegalAccessException, IllegalArgumentException {
        Object obj = field.get(this);
        if (!(obj instanceof List)) {
            return super.getValue(field, z);
        }
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append('[');
        List list = (List) obj;
        if (list.size() > 0) {
            stringBuilder.append(ˏ(field, list.get(0), z));
        }
        for (int i = 1; i < list.size(); i++) {
            stringBuilder.append(',').append(ˏ(field, list.get(i), z));
        }
        stringBuilder.append(']');
        return stringBuilder.toString();
    }
}
